home *** CD-ROM | disk | FTP | other *** search
- @echo off
- ! deldir.bat Batch file to delete a folder with all its contents
- !
- ! deldir name
- !
- ! where 'name' is the folder to be deleted. It can be preceded by a path and a
- ! volume ID.
- !
- ! deldir.bat calls uniqueTempName and deldir1
- !
- ! Copyright © 1994 by Rainbow Hill Pty Ltd. All rights reserved.
- !
-
- ! ensure that the first parameter is there and that the third one is not
- set doserr=13
- if not "%3 " == " " goto DONE_LBL
- if "%1 " == " " goto DONE_LBL
-
- ! ensure that the requested folder is there
- set doserr=27
- if not existdir "%1" goto DONE_LBL
-
- ! save the current directory: we will have to attach back in a couple of places
- set deldir_back=%where%
-
- onerror DONE_LBL
-
- ! recursively delete the content of the folder
- set doserr=0
- call deldir1 "%1"
-
- ! attach back to the original current directory, which was changed by deldir1
- cd "%deldir_back%"
-
- :DONE_LBL
- if not %doserr% == 0 show %doserr%
- !
- ! remove the global variables
- set deldir_back=
-